#pragma once

#include <QDialog>
#include "poco/word.h"

namespace Ui {
    class DictationDialog;
}

namespace WordMemory {

class DictationDialog : public QDialog
{
    Q_OBJECT

public:
    enum DictationResult {
        ConfirmedCorrect,
        ConfirmedWrong,
        Abandoned,
        Finished
    };

public:
    explicit DictationDialog(QWidget *parent = nullptr);
    ~DictationDialog();

    void startDictation(const Word& wordToDictate);
    QString getEnteredWord() const;
    Word getCurrentWord() const;

signals:
    void dictationActionTaken(DictationResult result, const Word& word);

private slots:
    void onConfirmClicked();
    void onAbandonClicked();
    void onFinishClicked();

private:
    void setupCustomButtons();
    void clearFeedback();

    Ui::DictationDialog *ui;
    Word currentWord;

    QPushButton* confirmButton;
    QPushButton* abandonButton;
    QPushButton* finishButton;
};

} // namespace WordMemory
